<template>
  <div class="box-list-container">
    <div class="box-query-form">
      <el-form :model="queryParam" label-width="auto" label-position="right" :gutter="24">
        <el-row>
          <el-col :span="24">
            <el-form-item label="操作类型:">
              <div>
                <el-button type="success" size="small" @click="actionTypeCheckAll">全选</el-button>
                <el-button type="info" size="small" style="margin-right: 10px;" @click="actionTypeCheckOutAll">全不选</el-button>
                <el-checkbox-group v-model="queryParam.actionType" size="small">
                  <el-checkbox-button v-for="item in actionTypeList" :key="item.code" :label="item.code">{{ item.name }}</el-checkbox-button>
                </el-checkbox-group>
              </div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xl="6" :lg="6" :md="12" :sm="24">
            <el-form-item label="标题-链接:">
              <el-input v-model="queryParam.goodsTitleOrLink" clearable placeholder="请输入" />
            </el-form-item>
          </el-col>
          <el-col :xl="6" :lg="6" :md="12" :sm="24">
            <el-form-item label="店铺:">
              <el-input v-model="queryParam.sName" clearable placeholder="请输入" />
            </el-form-item>
          </el-col>
          <el-col :xl="6" :lg="6" :md="12" :sm="24">
            <el-form-item label="抢单成功设备:">
              <el-input v-model="queryParam.deviceId" clearable placeholder="请输入" />
            </el-form-item>
          </el-col>
          <template v-if="toggleSearchStatus">
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="允许抢单设备:">
                <el-input v-model="queryParam.grabOrderDevice" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="订单号:">
                <el-input v-model="queryParam.orderNo" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="代付账号:">
                <el-input v-model="queryParam.replacePayAccount" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="状态说明:">
                <el-input v-model="queryParam.tStateExplain" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="评价说明:">
                <el-input v-model="queryParam.tEvaluateStateExplain" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="连续发布:">
                <el-input v-model="queryParam.continuousIssue" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="是否浏览:">
                <el-input v-model="queryParam.isBrowse" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="下单数:">
                <el-input v-model="queryParam.orderNum" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="商品链接数1带:">
                <el-input v-model="queryParam.spljsyidai" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="图片:">
                <el-input v-model="queryParam.img" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="支付密码:">
                <el-input v-model="queryParam.payPwd" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="付款方式:">
                <el-select v-model="queryParam.payMethod" filterable clearable placeholder="请选择">
                  <el-option v-for="item in payMethodList" :key="item.code" :value="item.code" :label="item.name" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="间隔时间:">
                <el-input v-model="queryParam.intervalTime" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="自动收货:">
                <el-select v-model="queryParam.vTakeDelivery" filterable clearable placeholder="请选择">
                  <el-option v-for="item in vTakeDeliveryList" :key="item.code" :value="item.code" :label="item.name" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="自动收货间隔时间:">
                <el-input v-model="queryParam.vTakeDeliveryIntervalTime" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="下单前清空购物车:">
                <el-select v-model="queryParam.xdqqkgwc" filterable clearable placeholder="请选择">
                  <el-option v-for="item in xdqqkgwcList" :key="item.code" :value="item.code" :label="item.name" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="APP:">
                <el-select v-model="queryParam.app" filterable clearable placeholder="请选择">
                  <el-option value="淘宝" label="淘宝" />
                  <el-option value="淘特" label="淘特" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="标题查找超时:">
                <el-input v-model="queryParam.btczcs" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="评价获取时间:">
                <el-input v-model="queryParam.evaluateGetTime" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="评价结束时间:">
                <el-input v-model="queryParam.evaluateEndTime" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="评价分组:">
                <el-input v-model="queryParam.qrshhpj" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="小号备份名:">
                <el-input v-model="queryParam.wcNxshqrsh" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="ID:">
                <el-input v-model="queryParam.id" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col :xl="12" :lg="12" :md="12" :sm="24">
              <el-form-item label="创建时间:">
                <el-date-picker
                  v-model="queryParam.timeTemp1"
                  type="datetimerange"
                  :picker-options="pickerOptions"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                  align="right"
                  @change="getTimeScope1"
                />
              </el-form-item>
            </el-col>
            <el-col :xl="12" :lg="12" :md="12" :sm="24">
              <el-form-item label="开始时间:">
                <el-date-picker
                  v-model="queryParam.timeTemp4"
                  type="datetimerange"
                  :picker-options="pickerOptions"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                  align="right"
                  @change="getTimeScope4"
                />
              </el-form-item>
            </el-col>
            <el-col :xl="12" :lg="12" :md="12" :sm="24">
              <el-form-item label="结束时间:">
                <el-date-picker
                  v-model="queryParam.timeTemp2"
                  type="datetimerange"
                  :picker-options="pickerOptions"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                  align="right"
                  @change="getTimeScope2"
                />
              </el-form-item>
            </el-col>
            <el-col :xl="12" :lg="12" :md="12" :sm="24">
              <el-form-item label="评价结束时间:">
                <el-date-picker
                  v-model="queryParam.timeTemp3"
                  type="datetimerange"
                  :picker-options="pickerOptions"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                  align="right"
                  @change="getTimeScope3"
                />
              </el-form-item>
            </el-col>
            <el-col :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="备注:">
                <el-input v-model="queryParam.remark" clearable placeholder="请输入" />
              </el-form-item>
            </el-col>
            <el-col v-if="userInfo.userType === '666'" :xl="6" :lg="6" :md="12" :sm="24">
              <el-form-item label="所属用户:">
                <selectUser v-model.trim="queryParam.UserNum" />
              </el-form-item>
            </el-col>
          </template>
          <el-col :xl="6" :lg="6" :md="12" :sm="24" class="table-search-btn">
            <el-button icon="el-icon-refresh" @click="searchReset">重置</el-button>
            <el-button type="primary" icon="el-icon-search" @click="searchQuery">查询</el-button>
            <el-link style="margin-left: 10px;" type="primary" :underline="false" @click="toggleSearchStatus = !toggleSearchStatus">
              {{ toggleSearchStatus ? '收起' : '展开' }}
              <i :class="toggleSearchStatus ? 'el-icon-arrow-up' : 'el-icon-arrow-down'" />
            </el-link>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <div class="box-table">
      <div class="table-title">
        <div class="table-title-left">
          任务管理列表
        </div>
        <div>
          <el-button v-if="userInfo.userType !== '666'" style="margin-right: 10px;" type="danger" @click="handleBatchDelete()">删除</el-button>
          <el-popover
            placement="left"
            width="600"
            trigger="click"
          >
            <el-checkbox-group v-model="showColInfo1" @change="showColItemChange">
              <el-checkbox v-for="item in colNameDictList" :key="item.code" :label="item.code">{{ item.name }}</el-checkbox>
            </el-checkbox-group>
            <el-button slot="reference">显示隐藏列</el-button>
          </el-popover>
          <el-button v-if="userInfo.userType !== '666'" type="primary" style="margin-left: 10px;" @click="taskStart()">任务立即开始</el-button>
          <el-button v-if="userInfo.userType !== '666'" style="margin-left: 10px;" plain class="btnAdd" icon="el-icon-plus" @click="handleAdd('新增')">新增</el-button>
          <!-- <el-button type="primary" @click="confirmReceipt()">立即确认收货</el-button> -->
        </div>
      </div>
      <!-- 批量操作 -->
      <div v-if="selectedRowList.length" class="batchAction">
        <div class="batchAction-left">
          <el-dropdown>
            <el-button>
              批量操作 <i class="el-icon-arrow-down el-icon--right" />
            </el-button>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>
                <div v-if="userInfo.userType !== '666'" @click="batchDelete"><i class="el-icon-delete" />删除</div>
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div>
        <div class="batchAction-right">
          已选择
          <span style="font-weight: 700">
            <el-link type="primary" :underline="false">{{ selectedRowList.length }}</el-link>
          </span>项
          <el-link type="primary" :underline="false" style="margin-left: 24px;" @click="onClearSelected">清空</el-link>
        </div>
      </div>
      <!--  max-height="460" -->
      <el-table ref="table" :data="dataSource" border @selection-change="onSelectChange">
        <el-table-column v-if="userInfo.userType !== '666'" type="selection" width="55" />
        <el-table-column v-if="userInfo.userType === '666'" fixed="left" label="所属用户" prop="UserNum" min-width="100" />
        <!-- <el-table-column fixed="left" label="序号" width="70" type="index" /> -->
        <el-table-column v-if="showColInfo1.includes('id')" fixed="left" prop="id" label="ID" width="70" />
        <el-table-column v-if="showColInfo1.includes('goodsTitleOrLink')" fixed="left" prop="goodsTitleOrLink" label="宝贝标题或链接" min-width="200">
          <template slot-scope="scope">
            <div :title="scope.row.sName" class="overflow2">{{ scope.row.goodsTitleOrLink }}</div>
          </template>
        </el-table-column>
        <el-table-column v-if="showColInfo1.includes('isBrowse')" prop="isBrowse" label="是否浏览" width="100" />
        <el-table-column v-if="showColInfo1.includes('continuousIssue')" prop="continuousIssue" label="连续发布" width="100" />
        <el-table-column v-if="showColInfo1.includes('sName')" prop="sName" label="店铺" min-width="120">
          <template slot-scope="scope">
            <div :title="scope.row.sName" class="overflow2">{{ scope.row.sName }}</div>
          </template>
        </el-table-column>
        <el-table-column v-if="showColInfo1.includes('startTime')" prop="startTime" label="开始时间" min-width="170" />
        <el-table-column v-if="showColInfo1.includes('deviceId')" prop="deviceId" label="抢单成功设备" width="120" />
        <el-table-column v-if="showColInfo1.includes('grabOrderDevice')" prop="grabOrderDevice" label="允许抢单设备" width="150">
          <template slot-scope="scope">
            <div :title="scope.row.grabOrderDevice" class="overflow2">{{ scope.row.grabOrderDevice }}</div>
          </template>
        </el-table-column>
        <el-table-column v-if="showColInfo1.includes('actionType')" prop="actionType" label="操作类型" min-width="200">
          <template slot-scope="scope">
            <div>{{ getAssignDataLabel(scope.row.actionType, 'actionTypeList') }}</div>
          </template>
        </el-table-column>
        <el-table-column v-if="showColInfo1.includes('orderNum')" prop="orderNum" label="下单数" width="100" />
        <el-table-column v-if="showColInfo1.includes('replacePayAccount')" prop="replacePayAccount" label="代付账号" min-width="200" />
        <el-table-column v-if="showColInfo1.includes('spljsyidai')" prop="spljsyidai" label="商品链接数1带" width="150" />
        <el-table-column v-if="showColInfo1.includes('img')" prop="img" label="图片" min-width="100" />
        <el-table-column v-if="showColInfo1.includes('orderNo')" prop="orderNo" label="订单号" min-width="150" />
        <el-table-column v-if="showColInfo1.includes('payMethod')" prop="payMethod" label="付款方式" min-width="150">
          <template slot-scope="scope">
            <div>{{ getAssignDataLabel(scope.row.payMethod, 'payMethodList') }}</div>
          </template>
        </el-table-column>
        <el-table-column v-if="showColInfo1.includes('payPwd')" prop="payPwd" label="支付密码" width="120" />
        <el-table-column v-if="showColInfo1.includes('intervalTime')" prop="intervalTime" label="间隔时间" width="120" />
        <el-table-column v-if="showColInfo1.includes('vTakeDelivery')" prop="vTakeDelivery" label="自动收货" width="120" />
        <el-table-column v-if="showColInfo1.includes('vTakeDeliveryIntervalTime')" prop="vTakeDeliveryIntervalTime" label="自动收货间隔时间" width="200" />
        <el-table-column v-if="showColInfo1.includes('xdqqkgwc')" prop="xdqqkgwc" label="下单前清空购物车" width="150">
          <template slot-scope="scope">
            <div class="overflow2">{{ scope.row.xdqqkgwc }}<span v-if="scope.row.xdqqkgwc !== '不清空'">秒</span></div>
          </template>
        </el-table-column>
        <el-table-column v-if="showColInfo1.includes('qrshhpj')" prop="qrshhpj" label="评价分组 " min-width="170" />
        <el-table-column v-if="showColInfo1.includes('app')" prop="app" label="APP" width="120" />
        <el-table-column v-if="showColInfo1.includes('btczcs')" prop="btczcs" label="标题查找超时" width="130" />
        <el-table-column v-if="showColInfo1.includes('brushSeveralTimes')" prop="brushSeveralTimes" label="刷几遍" width="120" />
        <el-table-column v-if="showColInfo1.includes('tState')" prop="tState" label="状态" min-width="100">
          <template slot-scope="scope">
            <div>{{ getAssignDataLabel(scope.row.tState, 'stateList') }}</div>
          </template>
        </el-table-column>
        <el-table-column v-if="showColInfo1.includes('tStateExplain')" prop="tStateExplain" label="状态说明" min-width="120">
          <template slot-scope="scope">
            <div :title="scope.row.tStateExplain" class="overflow2">{{ scope.row.tStateExplain }}</div>
          </template>
        </el-table-column>
        <el-table-column v-if="showColInfo1.includes('tEvaluateState')" prop="tEvaluateState" label="评价状态" width="100">
          <template slot-scope="scope">
            <div>{{ getAssignDataLabel(scope.row.tEvaluateState, 'evaluateStateList') }}</div>
          </template>
        </el-table-column>
        <el-table-column v-if="showColInfo1.includes('tEvaluateStateExplain')" prop="tEvaluateStateExplain" label="评价说明" min-width="120">
          <template slot-scope="scope">
            <div :title="scope.row.tEvaluateStateExplain" class="overflow2">{{ scope.row.tEvaluateStateExplain }}</div>
          </template>
        </el-table-column>
        <el-table-column v-if="showColInfo1.includes('getTime')" prop="getTime" label="获取时间" width="170" />
        <el-table-column v-if="showColInfo1.includes('endTime')" prop="endTime" label="结束时间" width="170" />
        <el-table-column v-if="showColInfo1.includes('evaluateGetTime')" prop="evaluateGetTime" label="评价获取时间" min-width="200" />
        <el-table-column v-if="showColInfo1.includes('evaluateEndTime')" prop="evaluateEndTime" label="评价结束时间" min-width="200" />
        <el-table-column v-if="showColInfo1.includes('wcNxshqrsh')" prop="wcNxshqrsh" label="小号备份名" min-width="200" />
        <el-table-column v-if="showColInfo1.includes('qrshhpj')" prop="qrshhpj" label="评价分组 " min-width="150">
          <template slot-scope="scope">
            <div :title="scope.row.qrshhpj" class="overflow2">{{ scope.row.qrshhpj }}</div>
          </template>
        </el-table-column>
        <el-table-column v-if="showColInfo1.includes('remark')" prop="remark" label="备注" min-width="150">
          <template slot-scope="scope">
            <div :title="scope.row.remark" class="overflow2">{{ scope.row.remark }}</div>
          </template>
        </el-table-column>
        <el-table-column v-if="showColInfo1.includes('createUser')" prop="createUser" label="创建人" min-width="100" />
        <el-table-column v-if="showColInfo1.includes('createTime')" prop="createTime" label="创建时间" width="170" />
        <el-table-column v-if="userInfo.userType !== '666'" fixed="right" label="操作" width="100">
          <template slot-scope="scope">
            <!-- <el-button type="text" @click="handleEdit('查看', scope.row, true)">查看</el-button> -->
            <el-button type="text" @click="handleEdit('编辑', scope.row)">编辑</el-button>
            <el-popconfirm title="确定删除吗？" style="margin-left: 10px" @confirm="handleDelete(scope.row[guidFieldName])">
              <el-button slot="reference" type="text" style="color: red;">删除</el-button>
            </el-popconfirm>
          </template>
        </el-table-column>
      </el-table>
      <div class="box-paging">
        <Pagination
          v-show="ipagination.total > 0"
          layout="total, sizes, prev, pager, next"
          :total="ipagination.total"
          :page.sync="ipagination.pageNum"
          :limit.sync="ipagination.pageSize"
          @pagination="loadData"
        />
      </div>
    </div>
    <handleDrawer ref="modalForm" @ok="modalFormOk" />
  </div>
</template>

<script>
import { postAction } from '@/api/manage'
import { listMixin } from '@/mixins/listMixin'
import Pagination from '@/components/Pagination'
import handleDrawer from './components/handleDrawer'
import selectUser from '@/components/xm/selectUser/selectUser'
import { actionTypeList, stateList, evaluateStateList, colNameDictList, getAssignDataLabel, payMethodList, vTakeDeliveryList } from '@/utils/publicData'

export default {
  components: {
    Pagination,
    handleDrawer,
    selectUser
  },
  mixins: [listMixin],
  data() {
    return {
      guidFieldName: 'id', // 唯一标识字段
      ipagination: { // 分页参数
        pageNum: 1,
        pageSize: 50,
        total: 0
      },
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
            picker.$emit('pick', [start, end])
          }
        }]
      },
      queryParam: {
        actionType: []
      },
      toggleSearchStatus: false,
      xdqqkgwcList: [
        { name: '清空', code: '清空' },
        { name: '不清空', code: '不清空' }
      ],
      vTakeDeliveryList: vTakeDeliveryList,
      payMethodList: payMethodList,
      stateList: stateList,
      evaluateStateList: evaluateStateList,
      actionTypeList: actionTypeList,
      colNameDictList: colNameDictList,
      userInfo: this.$ls.get('USER_INFO') || {},
      showColInfo1: this.$ls.get('showColInfo1') || [],
      url: {
        list: 'taskList.aspx?action=GetList',
        delete: 'taskList.aspx?action=Delete',
        deleteBatch: 'taskList.aspx?action=DeleteBatch'
      }
    }
  },
  created() {},
  mounted() {},
  methods: {
    getAssignDataLabel,
    taskStart() {
      if (this.selectedRowList.length <= 0) {
        this.$message.warning('请选择一条记录！')
        return
      } else {
        const that = this
        this.$confirm('是否操作选中数据 执行“任务立即开始”?', '确认', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          console.log('要操作的ID', this.selectedRowList)
          that.$store.dispatch('app/setLoading', true)
          postAction('taskList.aspx?action=taskStart', { idList: this.selectedRowList }).then((res) => {
            if (res.code === 1) {
              that.$message.success(res.message || '操作成功！')
              that.loadData()
            } else {
              that.$message.warning(res.message || '操作失败！')
            }
          }).finally(() => {
            this.$store.dispatch('app/setLoading', false)
          })
        })
      }
    },
    // 立即确认收货
    confirmReceipt() {
      if (this.selectedRowList.length <= 0) {
        this.$message.warning('请选择一条记录！')
        return
      } else {
        const that = this
        this.$confirm('是否操作选中数据 执行“立即确认收货”?', '确认', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          console.log('要操作的ID', this.selectedRowList)
          that.$store.dispatch('app/setLoading', true)
          postAction('taskList.aspx?action=confirmReceipt', { idList: this.selectedRowList }).then((res) => {
            if (res.code === 1) {
              that.$message.success(res.message || '操作成功！')
              that.loadData()
            } else {
              that.$message.warning(res.message || '操作失败！')
            }
          }).finally(() => {
            this.$store.dispatch('app/setLoading', false)
          })
        })
      }
    },
    // 批量删除
    handleBatchDelete() {
      this.batchDelete()
    },
    // 全选
    actionTypeCheckAll() {
      this.queryParam.actionType = this.actionTypeList.map(v => v.code)
    },
    // 全不选
    actionTypeCheckOutAll() {
      this.queryParam.actionType = []
    },
    // 添加查询参数 默认加空对象
    addQueryParams() {
      return {
        isPublish: '1'
      }
    },
    // 重置
    searchReset() {
      this.queryParam = {
        actionType: []
      }
      this.loadData(1)
    },
    // 选中列
    showColItemChange(c) {
      if (c && c.length) {
        this.$ls.set('showColInfo1', c)
      }
    },
    // 创建时间
    getTimeScope1(e) {
      if (e) {
        this.queryParam.ctime1 = this.$moment(e[0]).format('YYYY-MM-DD HH:mm:ss')
        this.queryParam.ctime2 = this.$moment(e[1]).format('YYYY-MM-DD HH:mm:ss')
      } else {
        this.queryParam.ctime1 = ''
        this.queryParam.ctime2 = ''
      }
    },
    // 结束时间
    getTimeScope4(e) {
      if (e) {
        this.queryParam.stime1 = this.$moment(e[0]).format('YYYY-MM-DD HH:mm:ss')
        this.queryParam.stime2 = this.$moment(e[1]).format('YYYY-MM-DD HH:mm:ss')
      } else {
        this.queryParam.stime1 = ''
        this.queryParam.stime2 = ''
      }
    },
    // 结束时间
    getTimeScope2(e) {
      if (e) {
        this.queryParam.etime1 = this.$moment(e[0]).format('YYYY-MM-DD HH:mm:ss')
        this.queryParam.etime2 = this.$moment(e[1]).format('YYYY-MM-DD HH:mm:ss')
      } else {
        this.queryParam.etime1 = ''
        this.queryParam.etime2 = ''
      }
    },
    // 评价结束时间
    getTimeScope3(e) {
      if (e) {
        this.queryParam.evaluateEndTime1 = this.$moment(e[0]).format('YYYY-MM-DD HH:mm:ss')
        this.queryParam.evaluateEndTime2 = this.$moment(e[1]).format('YYYY-MM-DD HH:mm:ss')
      } else {
        this.queryParam.evaluateEndTime1 = ''
        this.queryParam.evaluateEndTime2 = ''
      }
    },
    handleEdit(title, rowData, disableSubmit) {
      this.$refs.modalForm.edit(rowData)
      this.$refs.modalForm.title = title
      this.$refs.modalForm.disableSubmit = disableSubmit
    }
  }
}
</script>

<style lang="scss" scoped>
.overflow2{
  word-break: break-all;
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.dispalyFlex{
  display: flex;
  align-items: center;
}
</style>

